package com.taoym.voucher.xcx.controller;

import com.taoym.voucher.common.response.Response;
import com.taoym.voucher.xcx.entity.vo.XcxGetUserWithdrawVO;
import com.taoym.voucher.xcx.service.XcxUserWithdrawService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/withdraw")
@Api(tags = "提现控制器")
@Validated
public class XcxUserWithdrawController {

    @Autowired
    private XcxUserWithdrawService xcxUserWithdrawService;

    @ApiOperation("申请提现")
    @GetMapping("/apply")
    public Response<Boolean> applyWithdraw() {
        return Response.success(xcxUserWithdrawService.applyUserWithdraw());
    }

    @ApiOperation("查询我的提现信息")
    @GetMapping("/list/my")
    public Response<List<XcxGetUserWithdrawVO>> listMyWithdraws() {
        return Response.success(xcxUserWithdrawService.getMyWithdraws());
    }
}
